﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Foothill.Utils;
using Foothill.Privilege.Entity;
using GGFW.Entity.SystemManage;
using GGFW.DataAccess.SystemManage;

namespace GGFW.BusinessLogic.SystemManage
{
    public class UserControl : IDisposable
    {
        #region 更改用户密码
        /// <summary>
        /// 更改密码
        /// </summary>
        /// <param name="OldPwd"></param>
        /// <param name="NewPwd"></param>
        /// <returns></returns>
        public FoothillOperationResult<FoothillUser> UpdatePwd(int UserID, string NewPwd)
        {
            FoothillOperationResult<FoothillUser> result = new FoothillOperationResult<FoothillUser>();
            result.Success = true;
            try
            {
                using (UserDao dao = new UserDao())
                {
                    result.Success = dao.UpdatePwd(UserID, NewPwd);
                }
            }
            catch (Exception ex)
            {
                result.Success = false;
                result.Message = ex.Message;
            }
            return result;
        }
        #endregion

        #region IDisposable 成员

        public void Dispose()
        {
        }

        #endregion
    }
}
